home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5949 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: newsfeed.direct.ca!usenet
  2. From: etoivane@direct.ca (Ed Toivanen)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: 6 byte real to double; How?
  5. Date: 21 Feb 1996 23:01:30 GMT
  6. Organization: Your Organization
  7. Message-ID: <4gg88a$3oi@aphex.direct.ca>
  8. References: <3128306A.21F@hsc.unt.edu>
  9. NNTP-Posting-Host: 204.174.243.186
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.6
  13.  
  14. In article <3128306A.21F@hsc.unt.edu>, sfogoros@hsc.unt.edu says...
  15. >
  16. >I have a lot of data files that were created by a pascal program. The 
  17. >data is stored as 'file of real' meaning that each floating point value 
  18. >is stored in six bytes. I need to access this data from a c program 
  19. >(borland). I would like any assistance you could provide. I guess what 
  20. >I need is a canned function that would take a 6 byte string (actually the 
  21. >real), and return a double.
  22.  
  23. You need to know exactly how reals are interpreted by your pascal program. The 
  24. exact handling of a float is different(X bytes on the left side of the decimal, 
  25. Y bytes for precision) even across different C compilers, so I don't think 
  26. pascal would be much different in that respect. Once you know that, the rest is 
  27. a few C line away.
  28.  
  29. Ed
  30.  
  31.